<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProductsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('products', function (Blueprint $table) {
            $table->increments('id')->comment('ID');
            $table->text('description')->nullable()->comment('备注$textarea');
            $table->timestamps();
            $table->softDeletes();
            $table->integer('st_num')->default(0)->comment('数量');
            $table->string('st_coding', 255)->default('')->comment('内部编码id');
            $table->string('st_name', 255)->default('')->comment('产品名');
            $table->string('st_img', 100)->default('')->comment('产品图片');
            $table->string('st_asin', 80)->default('')->comment('产品Asin');
            $table->string('st_sku', 80)->default('')->comment('产品SKU');
            $table->string('st_label', 255)->default('')->comment('标签码地址');
            $table->string('st_upc', 80)->default('')->comment('UPS');
            $table->unsignedInteger('st_status')->default(0)->comment('产品状态 0-未审核 101-审核通过 301-审核未通过');
            $table->unsignedInteger('st_stocks')->default(0)->comment('库存');
            $table->unsignedInteger('st_weight')->default(0)->comment('产品重量 g为单位');
            $table->string('st_size', 80)->default('')->comment('产品尺寸 cm为单位');
            $table->decimal('st_head_cash', 10)->unsigned()->default(0.00)->comment('头程费用');
            $table->decimal('st_cash', 10)->unsigned()->default(0.00)->comment('采购成本');
            $table->unsignedInteger('st_is_small')->default(0)->comment('是否轻小件 1-是 2-否');
            $table->unsignedInteger('st_product_status')->default(0)->comment('产品状态 300-在售 301-新品 302-停售');
            $table->string('st_fnsku', 255)->default('')->comment('产品fnsku');
            $table->string('st_english', 80)->default('')->comment('英文关键词');
            $table->string('st_country', 255)->default('')->comment('国家 站点');
            $table->decimal('st_m_price', 10)->default(0.00)->comment('新品定价');
            $table->decimal('st_fba_cost', 10)->default(0.00)->comment('fba费用');
            $table->decimal('st_profit', 10)->default(0.00)->comment('利润');
            $table->decimal('st_profit_ratio', 10)->default(0.00)->comment('利润率');
            $table->boolean('st_is_repertory')->unsigned()->default(2)->comment('是否有库存');
            $table->integer('st_shop_id')->default(0)->comment('店铺id');
            $table->unsignedInteger('st_is_compose')->default(0)->comment('是否是组合 默认0 不是 1是组合');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('products');
    }
}
